import message from './Message.vue'
import Vue from 'vue'

const GetMessage = Vue.extend(message)

const serve = (params) => {
    let CreateMessage = new GetMessage()
    CreateMessage.$mount(document.createElement('div'))
    document.body.appendChild(CreateMessage.$el)
    CreateMessage.show = true
    CreateMessage.content = params
    Vue.nextTick(() => {
        setTimeout(() => {
            CreateMessage.show = false
        }, 2000)
    })

    return CreateMessage
}
export default serve